<script>on mouseUpanswer "Install ScrollBar XFCN into a stack?" with "No" or "Yes"if it <> "Yes" then exit mouseUpanswer file "Select target stack:" of type STAKput it into tofileif tofile is empty thenanswer "Installation cancelled" with "OK"exit mouseUpend ifDoInstall tofileend mouseUpon DoInstall tofileglobal External_Errorput word 2 of the long name of this stack into fromfiledelete last char of fromfiledelete first char of fromfileput resname into resname2 -- dest same nameResHandle "copy", fromfile, tofile, "XFCN", "ScrollBar", "ScrollBar"if "Ok" is in External_Error thenanswer "Installation complete" with "OK"elseanswer "Installation failed" with "OK"end ifend DoInstall</script>
</part>
<part>
<id>9</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <false /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>49</left>
<top>42</top>
<right>465</right>
<bottom>105</bottom>
</rect>
<style>transparent</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Times</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<textHeight>16</textHeight>
<name></name>
<script></script>
</part>
<part>
<id>12</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>82</left>
<top>109</top>
<right>437</right>
<bottom>128</bottom>
</rect>
<style>shadow</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Times</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<textHeight>16</textHeight>
<name></name>
<script></script>
</part>
<part>
<id>28</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <false /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>48</left>
<top>134</top>
<right>465</right>
<bottom>265</bottom>
</rect>
<style>scrolling</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <true /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Times</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<textHeight>16</textHeight>
<name>Copyright</name>
<script>on mouseUpif the textStyle of the clickChunk contains group thenpopupField "cd fld XCMDs"end ifend mouseUp</script>
</part>
<part>
<id>23</id>
<type>field</type>
<visible> <false /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>123</left>
<top>77</top>
<right>362</right>
<bottom>291</bottom>
</rect>
<style>opaque</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Helvetica</font>
<textSize>10</textSize>
<textStyle>plain</textStyle>
<textHeight>13</textHeight>
<name>XCMDs</name>
<script></script>
</part>
<content>
<layer>card</layer>
<id>8</id>
<text>Dr Nigel Perry, Department of Computer Science, Massey University,Palmerston North, New ZealandN.Perry@massey.ac.nz</text>
</content>
<content>
<layer>card</layer>
<id>9</id>
<text>The ScrollBar XFCN implements scroll bar controls for HyperCard. ScrollBar() must be invoked from a button/field script and will take its size from its parent object. After the scroll bar value has been changed ScrollBar() will optionally paint an updated picture of the bar onto the card or background as appropriate. ScrollBar() will also optionally send its parent object a message while it is tracking the scroll bar thumb.</text>
</content>
<content>
<layer>card</layer>
<id>12</id>
<text>Thanks to Maurice Volaski and his ScrollControl III for the original idea</text>
</content>
<content>
<layer>card</layer>
<id>23</id>
<text>As well as ScrollBar this stack contains:PopupField XCMD: This "pops" fields into windows which exist until a mouse click. It is being used to show you this. For more details see my stack popupfield-setcursor.VolumeLevel XFCN: Allows you to read and alter the volume level. Comes from my Macintalk 4.0 stack.ResHandle XFCN: Resource handling functions for HyperCard. The heart of the resource-library stack.All the above stacks should be available on sumex, umich or other archives.(Click to continue)</text>
</content>
<content>
<layer>card</layer>
<id>28</id>
<text><span class="style1">his package consists of the stack “ScrollBar Stack v2.0”. All </span><span class="style11"><a href="#" class="group">XCMD & XFCN</a></span><span class="style1"> code resources in this package are Copyright © 1992 by Nigel Perry. Code resources written using Think C therefore parts may be © Symantec.</span><span class="style9">PostcardWare</span><span class="style1">If you appreciate (or just use!) this package then please send me a postcard of your home area or town. Thank you.</span><span class="style10">LICENSE AGREEMENT</span><span class="style1">“You,” “your,” and the “user” refers to any person or entity which acquires or uses this software.“Software” refers to the computer programs identified above, together with all codes, techniques, software tools, formats, designs, concepts, methods, ideas, and documentation associated with the computer program(s). The term also includes all copies of any part of the software and documentation.“Author” refers to the author of this software, Dr Nigel PerryThis software is owned by the author and contains valuable and proprietary information of the author. If you violate any part of this agreement, your right to use this software terminates automatically. In the event of termination of this agreement, you must destroy all copies of this software and derivatives of this software in your possession.This software is being licensed to you as provided by the terms of this agreement.(1) You are permitted to copy and distribute this package unchanged, except as excluded by (3) and (4) below, provided that this notice is preserved on all copies.(2) If you are NOT an author of ShareWare software then you may use all or part of this package in stacks & applications for your personal use and in stacks & applications which you distribute free, except as excluded by (4) below, provided this notice is preserved.(3) If you ARE an author of ShareWare, then you may use this package for your personal use, except as excluded by (4) below, for a period of 7 days. To obtain permission to use this package after this period you must supply the author with a waiver in writing for the fees of all your ShareWare products. You will then be granted the same rights to use this software as is given to non ShareWare authors in (2) above.(4) This software, any part of it, or any derivative of it, cannot be used: for work, buisness, commercial or profit-making purposes; included with, or as part of, other products which are sold or distributed for profit; as an inducement to buy other products; or included in ShareWare; without the permission of the author. A licence fee will usually be charged for any use covered by this clause. School, college & university teachers, lecturers and researchers, and charitable institutions will normally not be charged a licence fee for use of this software in their work.(5) No warranty, either express or implied, is made with respect the softwares performance or fitness for purpose.(6) You may not reverse engineer, disassemble, decompile, or otherwise attempt to discover the logic or source code to this software.(Without prejudice to the above, the conditions might be paraphrased as</span><span class="style7"> “Provided you don't make money out of this software or charge me for your software [unless written as part of your job and sold as a commercial product], then you may use this software for free. If you wish to make money out of my software or charge me for yours then you don't get to use this for free”</span><span class="style1">. That's reasonable isn't it?)</span></text>
</content>
<name></name>
<script>on openStackset the scroll of cd fld "CopyRight" to 0pass openStackend openStack</script>
</card>
card_4363.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<script>on mouseUpif the textStyle of the clickChunk contains group thenpopupField "cd fld" && quote & "AboutStyle" & quoteend ifend mouseUp</script>
</part>
<part>
<id>5</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>285</left>
<top>45</top>
<right>504</right>
<bottom>115</bottom>
</rect>
<style>transparent</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Helvetica</font>
<textSize>10</textSize>
<textStyle>plain</textStyle>
<textHeight>13</textHeight>
<name></name>
<script></script>
</part>
<part>
<id>6</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>286</left>
<top>132</top>
<right>504</right>
<bottom>162</bottom>
</rect>
<style>transparent</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Helvetica</font>
<textSize>10</textSize>
<textStyle>plain</textStyle>
<textHeight>13</textHeight>
<name></name>
<script></script>
</part>
<part>
<id>7</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>286</left>
<top>180</top>
<right>504</right>
<bottom>289</bottom>
</rect>
<style>transparent</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Helvetica</font>
<textSize>10</textSize>
<textStyle>plain</textStyle>
<textHeight>13</textHeight>
<name></name>
<script></script>
</part>
<part>
<id>16</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>287</left>
<top>310</top>
<right>447</right>
<bottom>327</bottom>
</rect>
<style>transparent</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Helvetica</font>
<textSize>10</textSize>
<textStyle>plain</textStyle>
<textHeight>13</textHeight>
<name></name>
<script></script>
</part>
<part>
<id>21</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>35</left>
<top>45</top>
<right>252</right>
<bottom>115</bottom>
</rect>
<style>transparent</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Helvetica</font>
<textSize>10</textSize>
<textStyle>plain</textStyle>
<textHeight>13</textHeight>
<name></name>
<script></script>
</part>
<part>
<id>24</id>
<type>field</type>
<visible> <false /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>119</left>
<top>197</top>
<right>365</right>
<bottom>332</bottom>
</rect>
<style>opaque</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Helvetica</font>
<textSize>10</textSize>
<textStyle>plain</textStyle>
<textHeight>13</textHeight>
<name>AboutStyle</name>
<script></script>
</part>
<content>
<layer>card</layer>
<id>1</id>
<text>put ScrollBar(mouseDown, barStyle, doCallBack, min, max, current[, page]) into final</text>
</content>
<content>
<layer>card</layer>
<id>3</id>
<text><span class="style1">f </span><span class="style2">true</span><span class="style1"> ScrollBar() will asume a mouse down event has occurred, deal with the event and exit. If </span><span class="style2">false</span><span class="style1"> ScrollBar() will remain active as long as the mouse is within the scroll bar region and handle all mouse events during that time. Generally use </span><span class="style2">true</span><span class="style1"> if ScrollBar() is called from a </span><span class="style2">mouseDown</span><span class="style1"> handler, </span><span class="style2">false</span><span class="style1"> if called from a </span><span class="style2">mouseEnter</span><span class="style1"> handler. </span></text>
</content>
<content>
<layer>card</layer>
<id>4</id>
<text><span class="style1">f </span><span class="style2">paint</span><span class="style1"> ScrollBar() will draw a B&W control </span><span class="style7">and</span><span class="style1"> paint a </span><span class="style11"><a href="#" class="group">picture</a></span><span class="style1"> of the scroll bar onto the card or background before exiting. If </span><span class="style2">colour</span><span class="style1"> then a colour control is drawn if your Mac supports them. Anything else draws a B&W control.</span></text>
</content>
<content>
<layer>card</layer>
<id>5</id>
<text><span class="style1">f </span><span class="style2">true</span><span class="style1"> ScrollBar() will send a </span><span class="style2">trackScroll</span><span class="style1"> message to the object which called it while tracking the control. The </span><span class="style2">trackScroll</span><span class="style1"> handler can obtain the thumb value from the global </span><span class="style2">ScrollValue</span><span class="style1">.</span></text>
</content>
<content>
<layer>card</layer>
<id>6</id>
<text>The minimum, maximum and current thumb value for the scroll bar.</text>
</content>
<content>
<layer>card</layer>
<id>7</id>
<text><span class="style1">he amount to adjust the thumb by for mouse clicks in the page up/down regions. If not given a value of 2 is used.If a negative value is used and barStyle is </span><span class="style2">paint</span><span class="style1"> then ScrollBar() will paint onto the card or background without handling any events; this is used to force a paint when setting up a scroll bar.</span></text>
</content>
<content>
<layer>card</layer>
<id>16</id>
<text>The final value of the thumb.</text>
</content>
<content>
<layer>card</layer>
<id>21</id>
<text>ScrollBar() provides standard scroll bar controls as HyperCard objects. ScrollBar() must be invoked from either a button or field script and will draw the scroll bar to cover the rectangle of its parent object.</text>
</content>
<content>
<layer>card</layer>
<id>24</id>
<text>The userLevel does NOT need to be set to painting when barStyle is paint – ScrollBar() will adjust and reset it if need be. ScrollBar() paints onto the same layer, card or background, as its parent object.The painting is what causes the delay when exiting from ScrollBar(). Warning: You may get out of memory errors when ScrollBar attempts to paint (at least I sometimes do on a 1M Mac+…), in which case the scroll bar picture will be left on the clipboard.(Click to continue)</text>
</content>
<name></name>
<script></script>
</card>
card_8553.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<script>on mouseEnterglobal Scale1, Scale2, Scale3, Range, Pageput the scroll of cd fld "Scroll1" into snumput round(snum/Scale1) into thumbput ScrollBar(false, paint, true, 0, Range, thumb, Page) into thumblock screenset the scroll of cd fld "Scroll1" to thumb * Scale1set the scroll of cd fld "Scroll2" to thumb * Scale2set the scroll of cd fld "Scroll3" to thumb * Scale3unlock screenend mouseEnteron trackScrollglobal ScrollValue, Scale1, Scale2, Scale3lock screenset the scroll of cd fld "Scroll1" to ScrollValue * Scale1set the scroll of cd fld "Scroll2" to ScrollValue * Scale2set the scroll of cd fld "Scroll3" to ScrollValue * Scale3unlock screenend trackScrollon initBarglobal Scale1, Scale2, Scale3, Range, Pagelock screenput the textHeight of cd fld "Scroll1" into Scale1put the textHeight of cd fld "Scroll2" into Scale2put the textHeight of cd fld "Scroll3" into Scale3set the scroll of cd fld "Scroll1" to 0set the scroll of cd fld "Scroll2" to 0set the scroll of cd fld "Scroll3" to 0put the number of lines in cd fld "Scroll1" into lnumput the height of cd fld "Scroll1" into heightput lnum - trunc(height/Scale1) into Rangeput lnum - range into Pageput ScrollBar(false, paint, true, 0, Range, 0, -1) into itend initBar</script>
</part>
<part>
<id>7</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>17</left>
<top>250</top>
<right>300</right>
<bottom>271</bottom>
</rect>
<style>opaque</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Geneva</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<textHeight>16</textHeight>
<name></name>
<script></script>
</part>
<part>
<id>8</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>308</left>
<top>116</top>
<right>494</right>
<bottom>270</bottom>
</rect>
<style>transparent</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Helvetica</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<textHeight>15</textHeight>
<name></name>
<script></script>
</part>
<part>
<id>9</id>
<type>field</type>
<visible> <false /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>15</left>
<top>15</top>
<right>497</right>
<bottom>273</bottom>
</rect>
<style>scrolling</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Monaco</font>
<textSize>9</textSize>
<textStyle>plain</textStyle>
<textHeight>12</textHeight>
<name>Script</name>
<script></script>
</part>
<content>
<layer>card</layer>
<id>1</id>
<text><span class="style1">crollBar() may be used to implement multiple scrolling fields. To do this set doCallBack to </span><span class="style4">true</span><span class="style1"> and write a </span><span class="style4">trackScroll</span><span class="style1"> handler to read the current thumb value and adjust the scroll value of your fields. To achieve a clean scroll </span><span class="style4">lock</span><span class="style1"> the screen within your </span><span class="style4">trackScroll</span><span class="style1"> handler before adjusting the scroll values and </span><span class="style4">unlock</span><span class="style1"> it again after. ScrollBar() will set things up so that this </span><span class="style4">lock</span><span class="style1">/</span><span class="style4">unlock</span><span class="style1"> will not destroy the scroll bar picture. For the best effect use a </span><span class="style4">mouseEnter</span><span class="style1"> handler to invoke ScrollBar() as this will provide a quick response to mouse clicks in the scroll bar.</span></text>
</content>
<content>
<layer>card</layer>
<id>2</id>
<text>ScrollBar() may be used to implement multiple scrolling fields. To do this set doCallBack to true and write a trackScroll handler to read thecurrent thumb value and adjust the scroll value of your fields. To achieve a clean scroll lock the screen within your trackScroll handler before adjusting the scroll values and unlock it again after. ScrollBar() will set things up so that this lock/unlock will not destroy the scroll bar picture. For the best effect use a mouseEnter handler to invoke ScrollBar() as this will provide a quick response tomouse clicks in the scroll bar.</text>
</content>
<content>
<layer>card</layer>
<id>4</id>
<text><span class="style1">crollBar() may be used to implement multiple scrolling fields. To do thisset doCallBack to </span><span class="style4">true</span><span class="style1"> and write a </span><span class="style4">trackScroll</span><span class="style1"> handler to read the current thumb value and adjust the scroll value of your fields. To achievea clean scroll </span><span class="style4">lock</span><span class="style1"> the screen within your </span><span class="style4">trackScroll</span><span class="style1"> handler before adjusting the scroll values and </span><span class="style4">unlock</span><span class="style1"> it again after. ScrollBar() will setthings up so that this </span><span class="style4">lock</span><span class="style1">/</span><span class="style4">unlock</span><span class="style1"> will not destroy the scroll bar picture. For the best effect use a </span><span class="style4">mouseEnter</span><span class="style1"> handler to invoke ScrollBar() as this will provide a quick response tomouse clicks in the scroll bar.</span></text>
</content>
<content>
<layer>card</layer>
<id>8</id>
<text><span class="style1">etting barStyle to </span><span class="style4">paint</span><span class="style1"> gives the best æsthetic effect but is slowed down by the HyperCard painting operations, this is the cause of the delay when the mouse leaves the scroll region. Using a </span><span class="style4">mouseEnter</span><span class="style1"> handler causes the cursor to change to an arrow while in the scroll region.</span></text>
</content>
<content>
<layer>card</layer>
<id>9</id>
<text>Script of the scroll bar button:on mouseEnter global Scale1, Scale2, Scale3, Range, Page put the scroll of cd fld "Scroll1" into snum put round(snum/Scale1) into thumb put ScrollBar(false, paint, true, 0, Range, thumb, Page) into thumb lock screen set the scroll of cd fld "Scroll1" to thumb * Scale1 set the scroll of cd fld "Scroll2" to thumb * Scale2 set the scroll of cd fld "Scroll3" to thumb * Scale3 unlock screenend mouseEnteron trackScroll global ScrollValue, Scale1, Scale2, Scale3 lock screen set the scroll of cd fld "Scroll1" to ScrollValue * Scale1 set the scroll of cd fld "Scroll2" to ScrollValue * Scale2 set the scroll of cd fld "Scroll3" to ScrollValue * Scale3 unlock screenend trackScrollon initBar global Scale1, Scale2, Scale3, Range, Page put the textHeight of cd fld "Scroll1" into Scale1 put the textHeight of cd fld "Scroll2" into Scale2 put the textHeight of cd fld "Scroll3" into Scale3 put the number of lines in cd fld "Scroll1" into lnum put the scroll of cd fld "Scroll1" into snum put the height of cd fld "Scroll1" into height put lnum - trunc(height/Scale1) into Range put lnum - range into Page put round(snum/Scale1) into thumb put ScrollBar(false, paint, true, 0, Range, thumb, -1) into thumbend initBar</text>
</content>
<name></name>
<script>on openCardglobal lockInitif lockInit then exit openCardsend initBar to cd btn "Scroller"end openCard</script>
</card>
card_8423.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<script>on mouseDownput VolumeLevel() into origput ScrollBar(true, paint, false, 0, 7, orig, 1) into newif new <> orig thenput VolumeLevel(new) into itplay "Boing"end ifend mouseDownon initBarput ScrollBar(false, paint, false, 0, 7, VolumeLevel(), -1) into itend initBar</script>
</part>
<part>
<id>2</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>394</left>
<top>165</top>
<right>454</right>
<bottom>212</bottom>
</rect>
<style>opaque</style>
<showName> <true /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <false /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>12694</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>Sample Tune</name>
<script>on mouseUpglobal Tempo, Pitchput 210 into Tempoput 4 into PitchplayTuneset the name of me to "Stop Sample"set the icon of me to "Sp 0"repeat foreverif the sound is "done" or the mouse is "down" then exit repeatend repeatplay stopset the name of me to "Sample Tune"set the icon of me to "Music Note"end mouseUp</script>
</part>
<part>
<id>3</id>
<type>field</type>
<visible> <false /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>15</left>
<top>15</top>
<right>497</right>
<bottom>273</bottom>
</rect>
<style>scrolling</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Monaco</font>
<textSize>9</textSize>
<textStyle>plain</textStyle>
<textHeight>12</textHeight>
<name>Script</name>
<script></script>
</part>
<content>
<layer>background</layer>
<id>3</id>
<text><span class="style1">he scroll bar adjusts the volume level of the Mac using my VolumeLevel() XFCN. ScrollBar() is called using a </span><span class="style5">mouseDown</span><span class="style1"> handler so the scroll bar is not activated unless a click occurs over the bar, this also means that the cursor will not change to an arrow in the scroll region until the button is clicked. No call back is used.The parent object of the scroll bar is a field — just to demonstrate the use of ScrollBar() from fields…</span></text>
</content>
<content>
<layer>card</layer>
<id>3</id>
<text>Script of scroll bar field:on mouseDown put VolumeLevel() into orig put ScrollBar(true, paint, false, 0, 7, orig, 1) into new if new <> orig then put VolumeLevel(new) into it play "Boing" end ifend mouseDownon initBar put ScrollBar(false, paint, false, 0, 7, VolumeLevel(), -1) into itend initBar</text>
</content>
<name></name>
<script>on openCardglobal lockInitif lockInit then exit openCardsend initBar to cd fld "Volume"end openCard</script>
</card>
card_3629.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<script>on mouseUpput VolumeLevel() into origset icon of cd btn "Speaker" to "Sp" && origput ScrollBar(false, standard, true, 0, 7, orig, 1) into newif new <> orig thenset the name of me to "Volume Level:" && newput VolumeLevel(new) into itplay "Boing"end ifset icon of cd btn "Speaker" to 0end mouseUpon initButtonset the name of me to "Volume Level:" && VolumeLevel()end initButtonon trackScrollglobal ScrollValueset icon of cd btn "Speaker" to "Sp" && ScrollValueend trackScroll</script>
</part>
<part>
<id>2</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>382</left>
<top>161</top>
<right>415</right>
<bottom>189</bottom>
</rect>
<style>transparent</style>
<showName> <false /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <false /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>Speaker</name>
<script></script>
</part>
<part>
<id>3</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>369</left>
<top>196</top>
<right>429</right>
<bottom>243</bottom>
</rect>
<style>opaque</style>
<showName> <true /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <false /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>12694</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>Sample Tune</name>
<script>on mouseUpglobal Tempo, Pitchput 210 into Tempoput 4 into PitchplayTuneset the name of me to "Stop Sample"set the icon of me to "Sp 0"repeat foreverif the sound is "done" or the mouse is "down" then exit repeatend repeatplay stopset the name of me to "Sample Tune"set the icon of me to "Music Note"end mouseUp</script>
</part>
<part>
<id>4</id>
<type>field</type>
<visible> <false /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>15</left>
<top>15</top>
<right>497</right>
<bottom>273</bottom>
</rect>
<style>scrolling</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Monaco</font>
<textSize>9</textSize>
<textStyle>plain</textStyle>
<textHeight>12</textHeight>
<name>Script</name>
<script></script>
</part>
<content>
<layer>background</layer>
<id>3</id>
<text><span class="style1">his button can also be used to adjust the volume level of the Mac. ScrollBar() is called from a </span><span class="style5">mouseUp</span><span class="style1"> handler, so to get the scroll bar you must first click on the button. As barStyle is </span><span class="style5">standard</span><span class="style1"> the scroll bar will be B&W and will not be painted onto the card by ScrollBar() before exiting, the latter makes the operation faster. While the scroll bar is being adjusted a speaker icon is altered to reflect the current volume, this is done using a </span><span class="style5">trackControl</span><span class="style1"> handler.</span></text>
</content>
<content>
<layer>card</layer>
<id>4</id>
<text>Script of Volume Level button:on mouseUp put VolumeLevel() into orig set icon of cd btn "Speaker" to "Sp" && orig put ScrollBar(false, standard, true, 0, 7, orig, 1) into new if new <> orig then set the name of me to "Volume Level:" && new put VolumeLevel(new) into it play "Boing" end if set icon of cd btn "Speaker" to 0end mouseUpon initButton set the name of me to "Volume Level:" & VolumeLevel()end initButtonon trackScroll global ScrollValue set icon of cd btn "Speaker" to "Sp" && ScrollValueend trackScroll</text>
</content>
<name></name>
<script>on openCardglobal lockInitif lockInit then exit openCardsend initButton to cd btn id 1end openCard</script>
</card>
card_6997.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<script>on doControlglobal Pitchput ScrollBar(false, colour, true, 0, 7, Pitch, 1) into Pitchput Pitch into cd fld "Pitch"end doControlon initButtonglobal Pitchput 4 into Pitchput Pitch into cd fld "Pitch"end initButtonon trackScrollglobal ScrollValueput ScrollValue into cd fld "Pitch"end trackScroll</script>
</part>
<part>
<id>3</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>378</left>
<top>174</top>
<right>394</right>
<bottom>202</bottom>
</rect>
<style>transparent</style>
<showName> <false /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <false /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name></name>
<script>on mouseUpsend doControl to cd btn "Pitch"end mouseUp</script>
</part>
<part>
<id>4</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>476</left>
<top>118</top>
<right>492</right>
<bottom>265</bottom>
</rect>
<style>transparent</style>
<showName> <false /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <false /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>Tempo</name>
<script>on doControlglobal Tempoput ScrollBar(false, colour, true, 1, 20, trunc(Tempo/30), 1) * 30 ¬into Tempoput Tempo into cd fld "Tempo"end doControlon initButtonglobal Tempoput 210 into Tempoput Tempo into cd fld "Tempo"end initButtonon trackScrollglobal ScrollValueput ScrollValue * 30 into cd fld "Tempo"end trackScroll</script>
</part>
<part>
<id>5</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>476</left>
<top>174</top>
<right>492</right>
<bottom>202</bottom>
</rect>
<style>transparent</style>
<showName> <false /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <false /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name></name>
<script>on mouseUpsend doControl to cd btn "Tempo"end mouseUp</script>
</part>
<part>
<id>6</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>371</left>
<top>219</top>
<right>431</right>
<bottom>266</bottom>
</rect>
<style>opaque</style>
<showName> <true /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <false /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>12694</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>Sample Tune</name>
<script>on mouseUpglobal Tempo, PitchplayTuneset the name of me to "Stop Sample"set the icon of me to "Sp 0"repeat foreverif the sound is "done" or the mouse is "down" then exit repeatend repeatplay stopset the name of me to "Sample Tune"set the icon of me to "Music Note"end mouseUp</script>
</part>
<part>
<id>7</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>350</left>
<top>178</top>
<right>377</right>
<bottom>199</bottom>
</rect>
<style>opaque</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>right</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<textHeight>16</textHeight>
<name>Pitch</name>
<script></script>
</part>
<part>
<id>8</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>443</left>
<top>178</top>
<right>475</right>
<bottom>199</bottom>
</rect>
<style>opaque</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>right</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<textHeight>16</textHeight>
<name>Tempo</name>
<script></script>
</part>
<part>
<id>9</id>
<type>field</type>
<visible> <false /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>15</left>
<top>15</top>
<right>497</right>
<bottom>273</bottom>
</rect>
<style>scrolling</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Monaco</font>
<textSize>9</textSize>
<textStyle>plain</textStyle>
<textHeight>12</textHeight>
<name>Script</name>
<script></script>
</part>
<content>
<layer>background</layer>
<id>3</id>
<text><span class="style1">he two buttons both popup a scroll bar when clicked which can then be used to alter the value of the pitch and tempo of the sample tune. The buttons do not call ScrollBar() directly but send a </span><span class="style5">doControl</span><span class="style1"> message to a larger button which is the desired size of the scroll bar. To enable colour scroll bar popup barStyle is set to </span><span class="style5">colour</span><span class="style1">; and to track the values doControl is set </span><span class="style5">true</span><span class="style1">.</span></text>
</content>
<content>
<layer>card</layer>
<id>7</id>
<text>4</text>
</content>
<content>
<layer>card</layer>
<id>8</id>
<text>210</text>
</content>
<content>
<layer>card</layer>
<id>9</id>
<text>Script of adjust pitch button:on mouseUp send doControl to cd btn "Pitch"end mouseUpScript of button Pitch:on doControl global Pitch put ScrollBar(false, colour, true, 0, 7, Pitch, 1) into Pitch put Pitch into cd fld "Pitch"end doControlon initButton global Pitch put 4 into Pitch put Pitch into cd fld "Pitch"end initButtonon trackScroll global ScrollValue put ScrollValue into cd fld "Pitch"end trackScroll</text>
</content>
<name></name>
<script>on openCardsend initButton to cd btn "Pitch"send initButton to cd btn "Tempo"end openCard</script>